import { get, post, put, deleteApi } from '@/utils/http.js'

const api = {
  insert: '/desktop/dict/insert',
  update: '/desktop/dict/update',
  delete: `/desktop/dict/delete/`,
  tree: '/desktop/dict/tree',
}

export const insert = (params) => {
  return post(api.insert, params)
}

export const update = (params) => {
  return put(api.update, params)
}

export const deleteDict = (id) => {
  return deleteApi(api.delete + id, null)
}

export const list = () => {
  return post(api.tree, null)
}
